# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-pyttsx
pkgname=('python2-pyttsx' 'python-pyttsx')
_pkgname=pyttsx
pkgver=1.1
pkgrel=10
pkgdesc='Cross platform text-to-speech.'
arch=('any')
url='https://pypi.org/project/pyttsx/#files'
license=('BSD')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('3a01de993ebdf2fd2b3f79a8ee8852aa6bda54041041784802cf06d3939c0e63a4b161a0969a94e659e67ec65c82d36fa8977ef1b6dd55c31c6d853f06a4b504')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-pyttsx() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-pyttsx() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

